import Vue from 'vue'
import App from './App.vue'
import router from './router'
import './css/style.css'
import './plugins/element.js'
import axios from 'axios' 
Vue.config.productionTip = false
Vue.prototype.$http = axios
//请求的根路径
axios.defaults.baseURL = 'http://localhost:9090/'

//响应拦截器
axios.interceptors.response.use((ret)=>{
  return ret.data ;
},(err)=>{
  console.log( err );
})

// 头部加个 token 信息
axios.interceptors.request.use( config => {
const token = localStorage.getItem('token')
config.headers.token = token
return config
})

new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
